package com.zzh.controller.utils;

import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/*
 * @Auther : wenrouyue
 * @Date : 2022/3/6-22:31
 */
@RestControllerAdvice
public class ProjectExceptionAdvice {
    @ExceptionHandler
    public R doException(Exception ex){
        ex.printStackTrace();
       return R.error(RMsg.ERROR_CODE,"服务器内部错误!");
    }
    @ExceptionHandler
    public R HttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException ex){
        ex.printStackTrace();
        return R.error(RMsg.ERROR_METHODS,"请求方法有误");
    }
}
